package ink.ykb.demo.permission.enums;

/**
 * 请求类型
 * @author mading
 *
 */
public enum MethodType {
  
  /** 0：GET */
  GET("GET",0),
  
  /** 1：POST */
  POST("POST",1),
  
  /** 2：PUT */
  PUT("PUT",2),
  
  /** 3：DELETE */
  DELETE("DELETE",3);
  
  private String name;
  
  private Integer value;
  
  private MethodType(String name, Integer value) {
      this.name = name;
      this.value = value;
  }
  
  public static MethodType getMethodType(Integer value) {
    if(value == null){
        return null;
    }
    MethodType[] values = MethodType.values();
    for (MethodType type : values) {
        if(type.getValue().equals(value)){
            return type;
        }
    }
    return null;
  }
  

  public String getName() {
      return name;
  }

  public Integer getValue() {
      return value;
  }

}
